<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>19-使用while循环计算1-100的整数和</title>
	</head>
	<body>
		<script type="text/javascript">
			var num = 1;
			var sum = 0;//定义一个变量去接收总和
			while(num<=100){
				sum+=num;
				num++;
			}
			console.log("Sum::"+sum);
			console.log("Num::"+num);
		</script>
	</body>
</html>
